/**
 * 睡眠
 * @param {number} ms 睡眠时间
 * @returns {Promise} 返回一个 Promise
 */
function sleep(ms) {
  return new Promise((resolve) => {
    const timer = setTimeout(() => {
      clearTimeout(timer)
      resolve()
    }, ms)
  })
}

export { sleep }